package com.shopmall.service;

import com.shopmall.mapper.AdminMapper;
import com.shopmall.pojo.Admin;
import com.shopmall.pojo.Goods;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service  //!!！这个注解绝对不能少
@Transactional
public class AdminServiceImpl implements AdminService{  //service层 同名接口实现类

    @Autowired
    AdminMapper adminMapper;

    @Override
    public List<Admin> queryAdminList(){
        return  adminMapper.queryAdminList();
    }

    @Override
    public List<Admin> queryAdminSysList(){
        return adminMapper.queryAdminSysList();
    }

    @Override
    public List<Admin> queryAdminMallList(){
        return adminMapper.queryAdminMallList();
    }

    @Override
    public Admin queryAdminById(int id){
        return adminMapper.queryAdminById(id);
    }

    @Override
    public Admin queryAdminByUsername(String username){
        return adminMapper.queryAdminByUsername(username);
    }

    @Override
    public int addAdmin(Admin admin){
        return adminMapper.addAdmin(admin);
    }

    @Override
    public int updateAdmin(Admin admin){
        return adminMapper.updateAdmin(admin);
    }

    public int modify_password(Admin admin){
        return adminMapper.modify_password(admin);
    }

    @Override
    public int deleteAdmin(int id){
        return adminMapper.deleteAdmin(id);
    }

    @Override
    public int headPic(Admin admin) {
        return adminMapper.headPic(admin);
    }
}
